import http from "@/utils/request";

class OrderAPI {
  // test get api
  static getMessageBoardsList(params = {}) {
    return http.post("/order/queryPageList", params, {
      custom: {
        auth: true,
        loading: true,
      },
    });
  }

  static postPlaceOrder(params = {}) {
    return http.post("/order/placeOrder", params, {
      custom: {
        auth: true,
        loading: true,
      },
    });
  }
  static getOrderDetails(id) {
    return http.get(`/order/details/${id}`, {
      custom: {
        auth: true,
        loading: true,
      },
    });
  }
  static orderUpdate(params) {
    return http.post("/order", params, {
      custom: {
        auth: true,
        loading: true,
      },
    });
  }
  // 退货
  static getReturnTypeNum(data) {
    return http.post("/returnOrder/returnTypeNum", {
      shopId: data.storeId,
      orderId: data.orderId,
    });
  }
  // 退货详情
  static getRefundOrderApi(data) {
    return http.post("returnOrder/queryPageList", {
      saleOrderNo: data.saleOrderNo, //'P2025022719382213',
      refundType: data.refundType,
      pageSize: 500,
      pageNum: 1,
    });
  }
}

export default OrderAPI;
